<?php
// Script to Install guestbook
// Not tested.
if(!isset($_POST['submit']){
	echo "<html>";
	echo "<head></head>";
	echo "<body>";
	echo "<form action=\"install.php\" method=\"post\">";
	echo "Insert Database Host (usually: localhost)";
	echo "<input type=\"text\" length=\"20\" maxlength=\"20\" name=\"dbhost\" />";
	echo "Insert Database Username";
	echo "<input type=\"text\" length=\"20\" maxlength=\"40\" name=\"dbuser\" />";
	echo "Insert Database Username Password";
	echo "<input type=\"password\" length=\"20\" maxlength=\"60\" name=\"dbpass\" />";
	echo "<input type=\"\" length=\"20\" maxlength=\"20\" name=\"dbname\" />";
	echo "<input type=\"submit\" value=\"absenden\" name=\"submit\" />";
	echo "</form>";
	echo "</body>";
	echo "</html>";
	@mysql_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'])
		or die("Verbindung zu MySQL Server fehlgeschlagen");
		$sqldata = "CREATE DATABASE $_POST['dbname'] IF NOT EXISTS";
	@mysql_query($sqldata);
	@mysql_select_db($_POST['dbname'])
		or die("Datenbankaktion fehlgeschlagen");
		$sqldata2 = "CREATE TABLE ´guestbook´ WHERE $_POST['dbname']";
	@mysql_query($sqldata2);
// © The Busfreak <dastimo@gmx.net> Burning Bird Dev, 2010
?>
